/********************************************************/
/*	Copyright (C) 2016 Gong Li Bin		 	*/
/*	Project:	GlbRtbEng-1.0.0			*/
/*	Author:		gong_libin			*/
/*	Date:		2016_06_26			*/
/*	File:		GlbRtbMain.h			*/
/********************************************************/

#ifndef	_GLBRTBMAIN_H
#define	_GLBRTBMAIN_H

#include "GlbTcp.h"
#include "GlbUdp.h"
#include "GlbTime.h"
#include "GlbThread.h"

#include <getopt.h>
#include <unistd.h>

#include "GlbRtbUtil.h"

#define	GLB_RN_PAIRS			64

void GlbRtbEngAdmin();
void* GlbRtbEngThread(void* pNULL);
void GlbRtbEngSetDisplay(GlbCls::CGlbSet rCSet);
void GlbRtbEngDimDisplay(GLBRTBRESULT_C& rCResult);
int GlbRtbEngRtbCore(GLBRTBREQ_S* pstReq, GLBRTBRES_S* pstRes);
int GlbRtbEngCompPrice(const void* pFirst, const void* pSecond);
void GlbRtbEngTimFilter(GLBRTBRESULT_C& rCResult, GLBRTBREQ_S* pstReq);
void GlbRtbEngDimFilter(GLBRTBRESULT_C& rCResult, GLBRTBREQ_S* pstReq);
void GlbRtbEngResValid(GLBRTBREQ_S* pstReq, GLBRTBRES_S* pstRes, GLBRAINFO_S* pstInfo);
int GlbRtbEngAddResult(GLBRTBINDEX_C& rCSrc, GLBRTBRESULT_C& rCDst, char* pszKey, USHORT usDim);

#endif /* _GLBRTBMAIN_H */
